#ifndef camera_h
#define camera_h

#include <cstdio>
#include <iostream>
#include <math.h> 
#include <vector>
#include <list>
#include "vec3.h"
#include "rply.h"

using namespace std;

typedef Vec3 Vector3;

typedef struct VCGCamera {
  Vec3 vp;
  Vec3 xa;
  Vec3 ya;
  Vec3 za;

  float focal;
  float sx, sy;
  float cx, cy;
  float vx, vy;
  float k1, k2, k3, k4;

  float n, f;
  float aspect;
  float fov;

  Vec3 color;
} VCGCamera;

VCGCamera *read_ply_cam(char *fname, VCGCamera *cam);
bool write_ply_cam(char *fname, VCGCamera *cam);

int read_xform(char *filename, double *T);
int read_calibration(char *filename,double *Kc, double *Rc,
		     double *Tc,double *Kp, double *Rp,double *Tp,
		     double *Rcp,double *Tcp, double *Icp);


#endif
